home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / APW Interfaces / CInclude / Shell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-26  |  7.4 KB  |  258 lines  |  [TEXT/MPS ]

  1. /********************************************
  2. ; File: Shell.h
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc.1986-92
  6. ; All Rights Reserved
  7. ;
  8. ********************************************/
  9. #ifndef __TYPES__
  10.     #include <TYPES.h>
  11. #endif
  12.  
  13. #ifndef    __GSOS__
  14.     #include <gsos.h>
  15. #endif
  16.  
  17. #ifndef __SHELL__
  18. #define __SHELL__
  19.  
  20.  /* GET/SET_LINE_INFO parameter block for class 0 calls */
  21. typedef struct {
  22.     char    *sfile;            /* address of source file name */
  23.     char    *dfile;            /* address of output file name */
  24.     char    *parms;            /* address of paramter list */
  25.     char    *istring;        /* address of language specific input string */
  26.     char    merr;            /* max error level allowed */
  27.     char    merrf;            /* max error level found */
  28.     char    lops;            /* operations flag */
  29.     char    kflag;            /* KEEP flag */
  30.     unsigned long mflags;    /* set of letters selected with '-' */
  31.     unsigned long pflags;    /* set of letters selected with '+' */
  32.     unsigned long org;        /* abs start address of non-relloc load file */
  33. } GetLInfoPB;
  34.  
  35.  /* GetLInfo/SetLInfo parameter block for level 1 calls */
  36. typedef struct {
  37.     int                pCount;            /* parameter count */
  38.     char            *sfile;            /* address of source file name */
  39.     char            *dfile;            /* address of output file name */
  40.     char            *parms;            /* address of paramter list */
  41.     char            *istring;        /* address of language specific input string */
  42.     char            merr;            /* max error level allowed */
  43.     char            merrf;            /* max error level found */
  44.     char            lops;            /* operations flag */
  45.     char            kflag;            /* KEEP flag */
  46.     struct {                        /* bit fields */
  47.         unsigned    filler:6;    unsigned    z:1;    unsigned    y:1;
  48.         unsigned    x:1;    unsigned    w:1;    unsigned    v:1;
  49.         unsigned    u:1;    unsigned    t:1;    unsigned    s:1;
  50.         unsigned    r:1;    unsigned    q:1;    unsigned    p:1;
  51.         unsigned    o:1;    unsigned    n:1;    unsigned    m:1;
  52.         unsigned    l:1;    unsigned    k:1;    unsigned    j:1;
  53.         unsigned    i:1;    unsigned    h:1;    unsigned    g:1;
  54.         unsigned    f:1;    unsigned    e:1;    unsigned    d:1;
  55.         unsigned    c:1;    unsigned    b:1;    unsigned    a:1;
  56.     }mflags;            /* set of letters selected with '-' */
  57.     struct {
  58.         unsigned    filler:6;    unsigned    z:1;    unsigned    y:1;
  59.         unsigned    x:1;    unsigned    w:1;    unsigned    v:1;
  60.         unsigned    u:1;    unsigned    t:1;    unsigned    s:1;
  61.         unsigned    r:1;    unsigned    q:1;    unsigned    p:1;
  62.         unsigned    o:1;    unsigned    n:1;    unsigned    m:1;
  63.         unsigned    l:1;    unsigned    k:1;    unsigned    j:1;
  64.         unsigned    i:1;    unsigned    h:1;    unsigned    g:1;
  65.         unsigned    f:1;    unsigned    e:1;    unsigned    d:1;
  66.         unsigned    c:1;    unsigned    b:1;    unsigned    a:1;
  67.     } pflags;            /* set of letters selected with '+' */
  68.     unsigned long    org;            /* abs start address of non-relloc load file */
  69. } GetLInfoGSPB;
  70.  
  71. /* FastFile call parameter block for level 0 calls */
  72. typedef struct {
  73.     int                action;            /* action parameter */
  74.     int                index;            /* index parameter */
  75.     int                flags;            /* flags parameter */
  76.     char            **file_handle;    /* handle to contents of file */
  77.     unsigned long    file_length;    /* length of file in memory */
  78.     char            *name;            /* name of file */
  79.     int                access;            /* access attribute */
  80.     int                file_type;        /* file type of file */
  81.     long            aux_type;        /* aux type of file */
  82.     int                storage_type;    /* storage type of file */
  83.     int                create_date;    /* creation date of file */
  84.     int                create_time;    /* creation time of file */
  85.     int                mod_date;        /* modification date of file */
  86.     int                mod_time;        /* modification time of file */
  87.     unsigned long    blocks_used;    /* blocks of disk space used by file */
  88. } FastFilePB;
  89.  
  90. /* FastFile call parameter block for level 1 calls */
  91. typedef struct {
  92.     int                pCount;            /* parameter count */
  93.     int                action;            /* action parameter */
  94.     int                index;            /* index parameter */
  95.     int                flags;            /* flags parameter */
  96.     char            **fileHandle;    /* handle to contents of file */
  97.     union {
  98.         ResultBuf255    *out;        /* name returned by indexed_load function */
  99.         GSString255        *in;        /* name supplied to FastFile call */
  100.     } pathName;
  101.     int                access;            /* access attribute */
  102.     int                fileType;        /* file type of file */
  103.     long            auxType;        /* aux type of file */
  104.     int                storageType;    /* storage type of file */
  105.     TimeRec            createDate;        /* creation date and time */
  106.     TimeRec            modDate;        /* modification date and time */
  107.     ResultBuf255Ptr    option;            /* option list */
  108.     unsigned long    fileLength;        /* length of file in memory */
  109.     unsigned long    blocksUsed;        /* blocks of disk space used by file */
  110. } FastFileGSPB;
  111.  
  112. /* parameter block for GetIODevices and SetIODevices calls */
  113. typedef struct {
  114.     int                output_type;
  115.     ProcPtr            output_addr;
  116.     int                error_type;
  117.     ProcPtr            error_addr;
  118.     int                input_type;
  119.     ProcPtr            input_addr;
  120. } IODevPB;
  121.  
  122. typedef struct {
  123.     int                pCount;
  124.     int                outputType;
  125.     ProcPtr            outputAddr;
  126.     int                errorType;
  127.     ProcPtr            errorAddr;
  128.     int                inputType;
  129.     ProcPtr            inputAddr;
  130. } IODevGSPB, *IODevGSPBPtr;
  131.  
  132. /* GetCommand call parameter block */
  133. typedef struct {
  134.     int                index;
  135.     int                restart;
  136.     int                __reserved__;
  137.     int                command;
  138.     char            name[16];
  139. } GetCommandPB;
  140.  
  141. typedef struct {
  142.     int                pCount;
  143.     int                index;
  144.     int                restart;
  145.     int                __reserved__;
  146.     int                command;
  147.     char            name[16];
  148. } GetCommandGSPB, *GetCommandGSPBPtr;
  149.  
  150. /* ChangeVector call parameter block */
  151. typedef struct {
  152.     int                __reserved__;
  153.     int                vector;
  154.     ProcPtr            procPtr;
  155.     ProcPtr            oldProcPtr;
  156. } ChangeVectorPB;
  157.  
  158. typedef struct {
  159.     int                pCount;
  160.     int                __reserved__;
  161.     int                vector;
  162.     ProcPtr            procPtr;
  163.     ProcPtr            oldProcPtr;
  164. } ChangeVectorGSPB;
  165.  
  166. /* parameter block for level 1 NextWildcard call */
  167. typedef struct { 
  168.     Word            pCount;
  169.     ResultBuf255    *pathName;
  170.     Word            access;
  171.     Word            fileType;
  172.     Longint            auxType;
  173.     Word            storageType;
  174.     TimeRec            createDate;
  175.     TimeRec            modDate;
  176.     ResultBuf255Ptr    optionList;
  177.     LongWord        eof;
  178.     LongWord        blocksUsed;
  179.     LongWord        resourceEOF;
  180.     LongWord        resourceBlocks;
  181. } NextWildcardGSPB; 
  182.  
  183. /* APW 1.x functions */
  184.  
  185. extern void        CHANGE_VECTOR();
  186. #define CONSOLE_OUT WRITE_CONSOLE
  187. extern void        DIRECTION();
  188. extern void        ERROR();
  189. extern void        EXECUTE();
  190. extern void        EXPAND_DEVICES();
  191. extern void        EXPORT();
  192. extern void        FASTFILE();
  193. extern void        GET_COMMAND();
  194. extern void        GET_IO_DEVICES();
  195. extern unsigned    int  GET_LANG();
  196. extern void        GET_LINFO();
  197. extern void        GET_VAR();
  198. extern void        INIT_WILDCARD();
  199. extern char        *NEXT_WILDCARD();
  200. #define POP_VARIABLES() asm {                     \
  201.                             jsl        0xe100a8    \
  202.                             dcw        0x0117        \
  203.                             dcl        0            \
  204.                         }
  205. #define PUSH_VARIABLES() asm {                    \
  206.                             jsl        0xe100a8    \
  207.                             dcw        0x0118        \
  208.                             dcl        0            \
  209.                             sta        >_toolErr    \
  210.                         }
  211. extern void        READ_INDEXED();
  212. #define READ_VARIABLE GET_VAR
  213. extern void        REDIRECT();
  214. extern void        SET_IO_DEVICES();
  215. extern void        SET_LANG();
  216. extern void        SET_LINFO();
  217. extern void        SET_STOP_FLAG();
  218. extern void        SET_VAR();
  219. extern int        STOP();
  220. extern void        UNSET_VARIABLE();
  221. extern unsigned long VERSION();
  222. extern void        WRITE_CONSOLE();
  223.  
  224. /* New ORCA 2.0 level 1 calls
  225.     (or alternate names for existing calls) */
  226.  
  227. extern void            ChangeVectorGS();
  228. #define ConsoleOutGS WriteConsoleGS
  229. extern int            DirectionGS();
  230. extern void            ErrorGS();
  231. extern void            ExecuteGS();
  232. extern char            *ExpandDevicesGS();
  233. extern void            ExportGS();
  234. extern void            FastFileGS();
  235. extern GetCommandPB    *GetCommandGS();
  236. extern IODevGSPB    *GetIODevicesGS();
  237. extern unsigned        GetLangGS();
  238. extern GetLInfoPB    *GetLInfoGS();
  239. extern char            *GetVarGS();
  240. extern void            InitWildcardGS();
  241. extern char            *NextWildcardGS();
  242. extern void            PopVariablesGS();
  243. extern void            PushVariablesGS();
  244. extern void            ReadIndexedGS();
  245. #define ReadVariableGS GetVarGS
  246. extern void            RedirectGS();
  247. extern void            SetIODevicesGS();
  248. extern void            SetLangGS();
  249. extern void            SetLInfoGS();
  250. extern void            SetStopFlagGS();
  251. extern void            SetVarGS();
  252. extern int            StopGS();
  253. extern void            UnsetVariableGS();
  254. extern unsigned long VersionGS();
  255. extern void            WriteConsoleGS();
  256.  
  257. #endif
  258.